package data;

/**
 *
 * @author groep 11
 * @date 2007-2008
 */
public class User {

    private int userId;
    private String lastName;
    private String firstName;
    private String username;
    private String password;
    private String email;
    private String country;
    private boolean active;
    private int tribeId;

    /**
     * Constructor with all parameters
     * @param userId
     * @param lastName
     * @param firstName
     * @param username
     * @param password
     * @param active
     * @param tribeId
     */
    public User(int userId, String lastName, String fistName, String username, String password, String email, String country, boolean active, int tribeId) {
        this.setUserId(userId);
        this.setUsername(username);
        this.setLastName(lastName);
        this.setFirstName(fistName);
        this.setPassword(password);
        this.setEmail(email);
        this.setCountry(country);
        this.setActive(active);
        this.setTribeId(tribeId);
    }

    /**
     * Constructor with all parameters but tribeId
     * TribeId is set to 1 by default ("no tribe")
     * @param userId
     * @param lastName
     * @param firstName
     * @param username
     * @param password
     * @param active
     */
    public User(int userId, String lastName, String fistName, String username, String password,  String email, String country, boolean active) {
        this(userId, lastName, fistName, username, password, email, country, active, 1); // Join "no tribe"
    }

    /**
     * Constructor with all parameters but tribeId and userId.
     * By default userId is set to 0, tribeId to 1 ("no tribe")
     * @param lastName
     * @param firstName
     * @param username
     * @param password
     * @param active
     */
    public User(String lastName, String firstName, String username, String password, String email, String country, boolean active) {
        this(0, lastName, firstName, username, password, email, country, active);
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String name) {
        this.lastName = name;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String passWord) {
        this.password = passWord;
    }
    
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getCountry() {
        return this.country;
    }
    
    public void setCountry(String country) {
        this.country = country;
    }
    
    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public int getTribeId() {
        return tribeId;
    }

    public void setTribeId(int tribeId) {
        this.tribeId = tribeId;
    }
    
    
    /**
     * Returns the username of a user as default display value.
     * @return username
     */
    @Override
    public String toString() {
        return getUsername();
    }
}
